package cn.acfda.service.impl;

import cn.acfda.dao.UserRepository;
import cn.acfda.po.User;
import cn.acfda.service.UserService;
import cn.acfda.util.MD5Utils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author ziye
 * @date 2020/12/5 10:13
 */
@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserRepository userRepository;

    @Override
    public User checkUser(String username, String password) {
        User user = userRepository.findByUsernameAndPassword(username, MD5Utils.code(password));
        return user;
    }
}
